<%@page import="com.multysite.entity.admin.Application"%>
<%@page import="java.util.TreeMap"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@page import="com.google.appengine.api.users.UserService"%>

<%
	UserService userService = UserServiceFactory.getUserService();
	TreeMap<String, String> error = (TreeMap<String, String>) request
	.getAttribute("error");
	Application obj = (Application) request.getAttribute("site");
	if (obj == null) {
		obj = new Application();
	}
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Create Your Own Website</title>
<style>
.error {
	color: red;
}
</style>
</head>
<body>
	<h1>Please Enter Website Information</h1>
	<form action="/create" method="post">
		<table style="padding-left: 20px">
			<tr>
				<td>Application Id :</td>
				<td><input type="text" name="applicationId" title="Application Id"></td>
				<td class="error">
					<%
						if (error != null && error.containsKey("applicationId")) {
					%> 
						<%=error.get("applicationId")%> 
					<%
					 	}
					%>
				</td>
			</tr>
			<tr>
				<td>Application Title :</td>
				<td><input type="text" name="applicationTitle" title="Application Title"></td>
				<td class="error">
					<%
						if (error != null && error.containsKey("applicationTitle")) {
					%> 
						<%=error.get("applicationTitle")%> 
					<%
					 	}
					 %>
				</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input type="submit" value="Submit" title="Submit">
				</td>
			</tr>
			<tr>
				<td></td>
				<td>					
					<%=userService.getCurrentUser().getEmail() %>&nbsp;
					<a href="/applications">(My Application)</a>&nbsp;|&nbsp;
					<a href="<%=userService.createLogoutURL("/")%>">(Logout)</a>
				</td>				
			</tr>
		</table>
		
	</form>
</body>
</html>